# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>

pkgname=secrets
pkgver=8.0
pkgrel=1
pkgdesc="Password manager for GNOME which makes use of the KeePass v.4 format"
arch=(any)
url="https://apps.gnome.org/Secrets"
license=('GPL3')
depends=(
  dconf
  gobject-introspection-runtime
  graphene
  gtk4
  hicolor-icon-theme
  libadwaita
  libpwquality
  python-cairo
  python-gobject
  python-pycryptodomex
  python-pykeepass
  python-pyotp
  python-validators
  python-zxcvbn
)
makedepends=(
  git
  gobject-introspection
  meson
)
checkdepends=(python-pytest)
provides=(gnome-passwordsafe)
conflicts=(gnome-passwordsafe)
replaces=(gnome-passwordsafe)
_commit=d2897f0589c266890f2faac284c9e865eb44562f  # tags/8.0^0
source=("git+https://gitlab.gnome.org/World/secrets.git/#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd secrets
  git describe --tags | sed 's/-/+/g'
}

build() {
  arch-meson secrets build
  ninja -C build
}

check() {
  # Exclude "test_element.py", as it will fail.
  ## https://gitlab.gnome.org/World/secrets/-/issues/481
  meson test -C build \
    'Validate desktop file' \
    'Validate metainfo file' \
    'Validate schema file'
}

package() {
  meson install -C build --destdir "$pkgdir"
}
